package org.ant.ctrl;

import java.util.ArrayList;

import org.ant.gui.AntFrame;

public class CodeErrorManager {

	private static ArrayList<String> errors = new ArrayList<String>();

	public static void clear() {
		errors.clear();
	}

	public static void display() {
		StringBuffer out = new StringBuffer();
		for (String error : errors) {
			out.append(error);
			out.append("\n");
		}
		System.out.println("Error:" + errors.size());
		AntFrame.getInstance().getInfTabbedPane().getProblemsPane().setOutput(
				out.toString());
	}

	public static void addError(String err, int line, int off) {
		String s = "line " + line + " off " + off + ":" + err;
	}

	public static void addError(String err) {
		errors.add(err);
	}
}
